using System;
using System.Web.Caching;

namespace JQuery.WebKit.Common.Caching
{
    public interface ICache
    {
        /// <summary>
        /// If an item with the same key already exists, it is overwriten with the new one.
        /// </summary>
        void AddItem(string key, object item);

        void AddItem(string key, object item, TimeSpan? expireTime, CacheItemRemovedCallback removedCallBack);
        
        /// <summary>
        /// 
        /// </summary>
        /// <returns>False if there is no item with this key</returns>
        bool RemoveItem(string key);
        
        /// <summary>
        /// 
        /// </summary>
        /// <returns>Null if there is no item with this key</returns>
        object GetItem(string key);

        /// <summary>
        /// 
        /// </summary>
        /// <returns>False if there is no item with this key</returns>
        bool UpdateItem(string key, object value);
    }
}
